fork download
  1. <?php
  2.  
  3. $resposta = 'Stream #0:0(und): Video: mpeg4 ...
  4. Stream #0:1(jpn): Audio: mp3 ...
  5. Stream #0:1(por): Subtitle:';
  6.  
  7. if (preg_match_all('/Stream\s[#](\d+:\d+)(\(\w+\))?:(\s\w+|)[ :]+(\w+|)/i', $resposta, $output) == 0) {
  8. echo 'Nenhuma informação encontrada';
  9. } else {
  10. print_r(array_map(null, ...$output));
  11. }
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => Stream #0:0(und): Video: mpeg4
            [1] => 0:0
            [2] => (und)
            [3] =>  Video
            [4] => mpeg4
        )

    [1] => Array
        (
            [0] => Stream #0:1(jpn): Audio: mp3
            [1] => 0:1
            [2] => (jpn)
            [3] =>  Audio
            [4] => mp3
        )

    [2] => Array
        (
            [0] => Stream #0:1(por): Subtitle:
            [1] => 0:1
            [2] => (por)
            [3] =>  Subtitle
            [4] => 
        )

)